#pragma once

#include <vector>
#include <memory>
#include <functional>
#include <transfer/ITransfer.h>
#include "tm/TM_ServiceId.h"

namespace ecarx::transfer::aptm {

    class APTMConn:public ITransfer{
        class NetAPTM;
        NetAPTM* mImpl;
        public:
        explicit APTMConn();
        ~APTMConn();
        //打开链接
        bool open() override;
        //关闭链接
        bool close() override;
        //将数据写到网络上
        bool write(const Signal &) override;
        const std::optional<Signal> read(const int32_t signalId) const override;
        NetState getState() override;
        void onSignalChanged(SignalChangeCallback && callback) override;
        void registerStateHandler(NetStateCallback && callback) override;
        

    };


    struct ValidOperationArray {
        int len;
        uint16_t *oper_ids;
    };

    static uint16_t CPOper[] = {};

}
